<?php
/* @var $this CmpPunishController */
/* @var $model CmpPunish */

$this->breadcrumbs=array(
	'综合控制台'=>array($this->pre_module_url.'/index/index'),
	'客户服务'=>array($this->pre_module_url.'/cmpServices/admin'),
	'违规管理'=>array($this->pre_module_url.'/cmpPunish/admin'),
	'违规处罚'
);

//违规类型
$reason = CmpPunish::model()->getZcuReason();
//违规处理
$result = CmpPunish::model()->getZcuResult();

?>

<?php $form=$this->beginWidget('CActiveForm', array(
	'id'=>'cmp-punish-form',
	'enableAjaxValidation'=>false,
)); ?>
	<?php echo $form->hiddenField($model,'zm_id')?>
	<ul class="form_list form_list2 mt10">
		<li class="title"><span class="fs_14 fw_b">创建违规</span></li>
		<li class="c_f"><span class="tit">选择违规店铺：</span>
			<div class="cont f_l"><?php echo CHtml::encode($company->zc_name)?></div>
		</li>
		<li class="c_f"><span class="tit">选择违规类型：</span>
			<div class="cont f_l">
				<ul class="sub_li">
					<?php if(!empty($reason)){ foreach($reason as $key=>$val){?>
						<li><?php echo CHtml::radioButton('CmpPunish[zcu_integral]','',array('class'=>'chk select_reason','value'=>$val['point']))?>
						<span><?php echo $val['title']?></span>，
						扣<?php echo $val['point']?>分
						</li>
					<?php }}?>
				</ul>
			</div>
		</li>
		<li class="c_f"><span class="tit">违规处罚：</span>
			<div class="cont f_l">
				<ul class="sub_li">
					<?php if(!empty($result)){ foreach($result as $key=>$val){?>
					<li><?php echo CHtml::radioButton('CmpPunish[zcu_result]','',array('class'=>'chk','value'=>$val['title']))?><?php echo CHtml::encode($val['title'])?></li>
					<?php }}?>	
				</ul>
			</div>
		</li>
		<li class="c_f"><span class="tit">违规原因：</span>
			<div class="cont f_l"></textarea><?php echo $form->textArea($model,'zcu_reason',array('class'=>'t_area','id'=>'zcu_reason','cols'=>50,'rows'=>3))?></div>
		</li>
		<li class="c_f"><span class="tit">&nbsp;</span>
			<div class="cont f_l">
				<?php echo CHtml::submitButton(Yii::t('adm','Save Date'),array('class'=>'mem_btn mem_btn20 mr5'))?>
				<?php echo CHtml::resetButton(Yii::t('adm','Reset'),array('class'=>'mem_btn mem_btn07'))?>
			</div>
		</li>
	</ul>	
<?php $this->endWidget(); ?>   	            


<script type="text/javascript">
$('.select_reason').bind('click',function(){
	$('#zcu_reason').val($(this).next('span').text());
});
</script>